﻿@inject AppConfiguration appConfiguration
@{
    ViewData["Title"] = "登 录";
}

@section Styles{
    <!--hzy-admin-ui-login-->
    <link href="/styles/hzy-admin-ui-login.css" rel="stylesheet">
}
@section Scripts{
    <script type="text/javascript">
        let app = new Vue({
            el: "#app",
            data: {
                userName: 'admin',
                userPassword: '123456',
                loginCode: "",
                loading:false,
            },
            mounted: function () {

            },
            methods: {
                check: function () {
                    this.loading = true;
                    http.post('/Admin/Login/Check', {
                        userName: this.userName,
                        userPassword: this.userPassword,
                        loginCode: this.loginCode
                    }).then(function (r) {
                        this.loading = false;
                        if (r.code !== 1) return;
                        tools.setCookie(tools.config().tokenKey, r.data.token);
                        window.location = '/';
                    });
                }
            }
        });
    </script>
}
<div id="app" v-cloak class="p-15">
    <div id="login">
        <div class="login-modal"></div>
        <div class="login-container">
            <el-card>
                <div class="login-title">@(appConfiguration.AppTitle)</div>
                <div class="p-20">
                    <div class="login-input">
                        <div class="form-title">用户名</div>
                        <input type="text" v-model="userName" />
                    </div>
                    <div class="login-input">
                        <div class="form-title">密码</div>
                        <input type="password" v-model="userPassword" />
                    </div>
                    <div class="login-btn">
                        <el-button type="primary" @@click="check" :loading="loading">登录</el-button>
                    </div>
                </div>
            </el-card>
        </div>
    </div>
</div>